package li.brauch.semesterarbeit.radio;

import java.util.ArrayList;
import java.util.List;

public abstract class AbstractRadio implements IRadio {
	
	private List<RadioPropertyListener> listeners = new ArrayList<RadioPropertyListener>();
	
	public void addRadioPropertyListener(RadioPropertyListener listener) {
		if (!listeners.contains(listener))
			listeners.add(listener);
	}
	
	public void removeRadioPropertyListener(RadioPropertyListener listener) {
		if (listeners.contains(listener))
			listeners.remove(listener);
	}
	
	protected void notifyRadioPropertyChanged() {
		for (RadioPropertyListener listener : listeners)
			listener.radioPropertyChanged();
	}
}
